package com.navi.core.gpEntity;

import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.*;
import java.sql.Date;
import java.sql.Timestamp;

@Entity
@Table(name = "m_cald_d", schema = "dm", catalog = "qmsprd")
public class MCaldD {
    private int caldKey;
    private String unqSeqId;
    @JSONField(name = "caldDate", format = "yyyy-MM-dd")
    private Date caldDate;
    private Integer dayInMon;
    private Integer dayInWeek;
    private Integer week;
    private Integer mon;
    private Integer ssn;
    private Integer year;
    private Integer workDayFlg;
    private String validFlag;
    private Timestamp evtTimestamp;
    private String evtUser;
    private String evtNote;

    @Id
    @Column(name = "cald_key")
    public int getCaldKey() {
        return caldKey;
    }

    public void setCaldKey(int caldKey) {
        this.caldKey = caldKey;
    }

    @Basic
    @Column(name = "unq_seq_id")
    public String getUnqSeqId() {
        return unqSeqId;
    }

    public void setUnqSeqId(String unqSeqId) {
        this.unqSeqId = unqSeqId;
    }

    @Basic
    @Column(name = "cald_date")
    public Date getCaldDate() {
        return caldDate;
    }

    public void setCaldDate(Date caldDate) {
        this.caldDate = caldDate;
    }

    @Basic
    @Column(name = "day_in_mon")
    public Integer getDayInMon() {
        return dayInMon;
    }

    public void setDayInMon(Integer dayInMon) {
        this.dayInMon = dayInMon;
    }

    @Basic
    @Column(name = "day_in_week")
    public Integer getDayInWeek() {
        return dayInWeek;
    }

    public void setDayInWeek(Integer dayInWeek) {
        this.dayInWeek = dayInWeek;
    }

    @Basic
    @Column(name = "week")
    public Integer getWeek() {
        return week;
    }

    public void setWeek(Integer week) {
        this.week = week;
    }

    @Basic
    @Column(name = "mon")
    public Integer getMon() {
        return mon;
    }

    public void setMon(Integer mon) {
        this.mon = mon;
    }

    @Basic
    @Column(name = "ssn")
    public Integer getSsn() {
        return ssn;
    }

    public void setSsn(Integer ssn) {
        this.ssn = ssn;
    }

    @Basic
    @Column(name = "year")
    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    @Basic
    @Column(name = "work_day_flg")
    public Integer getWorkDayFlg() {
        return workDayFlg;
    }

    public void setWorkDayFlg(Integer workDayFlg) {
        this.workDayFlg = workDayFlg;
    }

    @Basic
    @Column(name = "valid_flag")
    public String getValidFlag() {
        return validFlag;
    }

    public void setValidFlag(String validFlag) {
        this.validFlag = validFlag;
    }

    @Basic
    @Column(name = "evt_timestamp")
    public Timestamp getEvtTimestamp() {
        return evtTimestamp;
    }

    public void setEvtTimestamp(Timestamp evtTimestamp) {
        this.evtTimestamp = evtTimestamp;
    }

    @Basic
    @Column(name = "evt_user")
    public String getEvtUser() {
        return evtUser;
    }

    public void setEvtUser(String evtUser) {
        this.evtUser = evtUser;
    }

    @Basic
    @Column(name = "evt_note")
    public String getEvtNote() {
        return evtNote;
    }

    public void setEvtNote(String evtNote) {
        this.evtNote = evtNote;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MCaldD that = (MCaldD) o;

        if (caldKey != that.caldKey) return false;
        if (unqSeqId != null ? !unqSeqId.equals(that.unqSeqId) : that.unqSeqId != null) return false;
        if (caldDate != null ? !caldDate.equals(that.caldDate) : that.caldDate != null) return false;
        if (dayInMon != null ? !dayInMon.equals(that.dayInMon) : that.dayInMon != null) return false;
        if (dayInWeek != null ? !dayInWeek.equals(that.dayInWeek) : that.dayInWeek != null) return false;
        if (week != null ? !week.equals(that.week) : that.week != null) return false;
        if (mon != null ? !mon.equals(that.mon) : that.mon != null) return false;
        if (ssn != null ? !ssn.equals(that.ssn) : that.ssn != null) return false;
        if (year != null ? !year.equals(that.year) : that.year != null) return false;
        if (workDayFlg != null ? !workDayFlg.equals(that.workDayFlg) : that.workDayFlg != null) return false;
        if (validFlag != null ? !validFlag.equals(that.validFlag) : that.validFlag != null) return false;
        if (evtTimestamp != null ? !evtTimestamp.equals(that.evtTimestamp) : that.evtTimestamp != null) return false;
        if (evtUser != null ? !evtUser.equals(that.evtUser) : that.evtUser != null) return false;
        if (evtNote != null ? !evtNote.equals(that.evtNote) : that.evtNote != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = caldKey;
        result = 31 * result + (unqSeqId != null ? unqSeqId.hashCode() : 0);
        result = 31 * result + (caldDate != null ? caldDate.hashCode() : 0);
        result = 31 * result + (dayInMon != null ? dayInMon.hashCode() : 0);
        result = 31 * result + (dayInWeek != null ? dayInWeek.hashCode() : 0);
        result = 31 * result + (week != null ? week.hashCode() : 0);
        result = 31 * result + (mon != null ? mon.hashCode() : 0);
        result = 31 * result + (ssn != null ? ssn.hashCode() : 0);
        result = 31 * result + (year != null ? year.hashCode() : 0);
        result = 31 * result + (workDayFlg != null ? workDayFlg.hashCode() : 0);
        result = 31 * result + (validFlag != null ? validFlag.hashCode() : 0);
        result = 31 * result + (evtTimestamp != null ? evtTimestamp.hashCode() : 0);
        result = 31 * result + (evtUser != null ? evtUser.hashCode() : 0);
        result = 31 * result + (evtNote != null ? evtNote.hashCode() : 0);
        return result;
    }
}
